﻿@model ExpressQuiz.ViewModels.QuizDetailsViewModel


<h2>
    @Model.Quiz.Name  (@Model.Quiz.QuestionCount questions)
</h2>

<div class="container">

    <hr />


    <div class=" text-center">@Html.ActionLink("Start quiz", "Index", "ActiveQuiz", new { id = Model.Quiz.QuizId }, new { @class = "btn btn-lg btn-success" })</div>


    <br />

    <dl class="dl-horizontal">


        <dt>
            @Html.DisplayNameFor(model => model.Quiz.Summary)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Quiz.Summary)
        </dd>

        <br />

        <dt>
            @Html.DisplayNameFor(model => model.AvgScore)
        </dt>
        <dd>
            <div class="progress">
                <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: @Model.AvgScorePercent%;">
                    @Model.AvgScore / @Model.TotalPoints points
                </div>
            </div>
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.AvgTime)
        </dt>
        <dd>
            <div class="progress">
                <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: @Model.AvgTimePercent%;">
                    @Model.AvgTime / @Model.TotalTime seconds
                </div>
            </div>
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.AvgLevel)
        </dt>
        <dd>
            <div class="progress">
                <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: @Model.AvgLevel%;">
                    @Model.AvgLevel%
                </div>
            </div>
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.AvgRating)
        </dt>
        <dd>
            <div class="progress">
                <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: @Model.AvgRating%;">
                    @Model.AvgRating%
                </div>
            </div>
        </dd>





    </dl>



    @if (!Model.Quiz.Locked || Model.Quiz.CreatedBy == User.Identity.Name)
    {

        <div class="row">

            @Html.ActionLink("Edit", "Edit", new { id = Model.Quiz.QuizId },
                        new { @class = "btn btn-primary  " })




            @Html.ActionLink("Delete", "Delete", new { id = Model.Quiz.QuizId },
                        new { @class = "btn btn-danger  " })


        </div>

    }

</div>


<br />

<div>



    @Html.Action("Index", "Users", new { quizId = @Model.Quiz.QuizId })
</div>